.SUFFIXES : .x .o .c .s

ROOT = /usr/local/arm_linux_4.2/
LIB = $(ROOT)/lib/gcc/arm-linux/4.2.1
LIB1 =$(ROOT)/arm-linux/lib
LIBJPEG =./libjpeg
INC :=$(ROOT)/arm-linux/include
INCJPEG =./libjpeg
#INCJSON = ./libjson

CC=arm-linux-gcc -O1 -I$(INCJPEG) -I-$(INC) -static
WEC_LDFLAGS=-L$(LIBJPEG) -L$(LIB) -L$(LIB1) 
STRIP=arm-linux-strip

TARGET = sd700
SRCS := main.c input.c outtime.c windos.c frambuffer.c dataprocess.c bitstream.c  mask.c  mmask.c \
		mqrspec.c  qrencode.c  QR_Encode.c  qrinput.c  qrspec.c  rscode.c  split.c arraylist.c  \
		debug.c  json_object.c  json_tokener.c  json_util.c  linkhash.c  printbuf.c http.c comm.c \
		message.c localdata.c  updateRes.c des.c md5.c localupdate.c rtcfun.c jpegprocess.c
LIBS= -lc -lgcc -lpthread -ljpeg 

all: 
	$(CC) $(WEC_LDFLAGS) $(SRCS) -o $(TARGET) $(LIBS) -static
	$(STRIP) $(TARGET) 
	cp $(TARGET)  ./sd700_bat
	cp $(TARGET)  /tftpboot/
clean:
	rm -f *.o 
	rm -f *.x 
	rm -f *.flat
	rm -f *.map
	rm -f temp
	rm -f *.img
	rm -f $(TARGET)	
	rm -f *.gdb
	rm -f *.bak
